// This source is subject to the Microsoft Public License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

using System;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace QuoteAdvantageEditor
{
   public class DirBrowser : FolderNameEditor
   {
      FolderBrowser fb = new FolderBrowser();

      public string Description
      {
         set { _description = value; }
         get { return _description; }
      }  
     
      public string ReturnPath
      {
         get { return _returnPath; }
      }

      public DirBrowser() { }

      public DialogResult ShowDialog()
      {
         fb.Description = _description;

         // Unfortunately, the start locations are limited to the entries in the special folder enum
         fb.StartLocation = FolderBrowserFolder.MyComputer;

         DialogResult r = fb.ShowDialog();
         if (r == DialogResult.OK)
            _returnPath = fb.DirectoryPath;
         else
            _returnPath = String.Empty;

         return r;
      }

      private string _description = "Choose Directory";
      private string _returnPath = String.Empty;
  
   } // end class

}